<!-- 订单记录 -->
<div class="search">
  <nz-select style="width:300px;" [(ngModel)]="mid" nzAllowClear nzPlaceHolder="商户" *ngIf="isvisable" (ngModelChange)="searchData()">
    <nz-option *ngFor="let item of statuslist" [nzValue]="item.key" [nzLabel]="item.value"></nz-option>
  </nz-select>
  <nz-select style="width:300px;" [(ngModel)]="paystatus" nzAllowClear nzPlaceHolder="订单状态" (ngModelChange)="searchData()">
    <nz-option *ngFor="let item of paystatuslist" [nzValue]="item.key" [nzLabel]="item.value"></nz-option>
  </nz-select>
  订单日期:
  <nz-date-picker nzFormat="yyyy-MM-dd" [(ngModel)]="starttime" nzPlaceHolder="开始日期">
  </nz-date-picker>
  ~
  <nz-date-picker nzFormat="yyyy-MM-dd" [(ngModel)]="endtime" nzPlaceHolder="结束日期">
  </nz-date-picker>
  <a (click)="searchData()">查询</a>
</div>

<nz-table #ajaxTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzLoading]="loading" [nzTotal]="total"
  [nzShowTotal]="totalTemplate" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" (nzPageIndexChange)="searchData()"
  (nzPageSizeChange)="searchData(true)" [nzScroll]="{ x:'1500px',y: '400px' }" [nzFooter]="footerTemplate">
  <thead>
    <tr>
      <th nzWidth="40px" nzLeft="0px">序号</th>
      <th nzWidth="10px">用户昵称</th>
      <th nzWidth="120px">交易商户名称</th>
      <th nzWidth="120px">订单号</th>
      <th nzWidth="80px">消费金额(元)</th>
      <th nzWidth="80px">消费酒币(个)</th>
      <th nzWidth="80px">消费餐币(个)</th>
      <th nzWidth="80px">消费人数(个)</th>
      <th nzWidth="80px">平台佣金比例(%)</th>
      <th nzWidth="80px">平台抽取佣金(元)</th>
      <th nzWidth="80px">大使奖励比例(%)</th>
      <th nzWidth="80px">大使奖励(元)</th>
      <th nzWidth="80px">支付状态</th>
      <th nzWidth="80px">支付方式</th>
      <th nzWidth="140px">订单时间</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of ajaxTable.data;index as i">
      <td nzLeft="0px">{{i+1}}</td>
      <td>{{data.nickname}}</td>
      <td>{{data.mername}}</td>
      <td>{{data.code}}</td>
      <td>{{data.money}}</td>
      <td>{{data.conins}}</td>
      <td>{{data.meal}}</td>
      <td>{{data.person}}</td>
      <td>{{data.rate}}</td>
      <td>{{data.ratemoney}}</td>
      <td>0.5</td>
      <td>{{data.agentreward}}</td>
      <td>{{data.paystatus}}</td>
      <td>{{data.paytype}}</td>
      <td>{{data.end_time}}</td>
    </tr>
  </tbody>
</nz-table>

<ng-template #footerTemplate let-footer>
    {{footTotal}}
  </ng-template>
<ng-template #totalTemplate let-total>
  共 {{total}} 条
</ng-template>